﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

using Server.Comm;
using Server.Login;
using Server.Utils.JSON;

namespace Server.Account
{
    public class AccountObj
    {
        CommObj m_commObj = null;
        int m_uid = -1;
        Guid m_guid;

        public AccountObj(CommObj commObj, int uid, Guid guid)
        {
            m_commObj = commObj;
            m_uid = uid;
            m_guid = guid;
        }

        public void Start()
        {
            m_commObj.OnReceive += new ReceiveHandler(OnRecevie);
            m_commObj.BeginReceive();
        }

        public void Disconnect()
        {
            m_commObj.Close();
            LoginMgr.GetInstance().Logout(m_guid);
        }

        private void OnRecevie(CommObj sender, JSONObject obj)
        {

        }
    }
}